#!/opt/local/bin/perl

#my @data = (55,63,73,84,97,113,132,157,188);
#3,5,8,11,14,18,21,26,30,35,41,47,55,63,73,84,97,113,132,157,188,230,288,376,522,813,1690
#my @data = (13,18,23,28,35,42,50,60,71,84,100,120,144,175,217);
# 5,9,13,18,23,28,35,42,50,60,71,84,100,120,144,175,217,275,363,509,800,1676
#3 my @data = (75,86,100,116,135,159);
# 20,24,28,33,38,43,50,57,65,75,86,100,116,135,159,190,232,291,378,524,816,1691
#4 my @data = (18,20,22,24,26,28,31,33,36,39,42,45,49,53,57,61,65,70,76,82,88,95,103,112,121,132,144,157,173,190,211);
# 16,18,20,22,24,26,28,31,33,36,39,42,45,49,53,57,61,65,70,76,82,88,95,103,112,121,132,144,157,173,190,211,237,266,302,348,406,484,592,756,1027,1571,3202
#5 my @data = (50,58,68,79,92,108,127,152,183);
# 3,6,9,12,16,20,25,30,36,42,50,58,68,79,92,108,127,152,183,225,283,370,516,808,1683
#6 my @data = (16,21,25,31,37,43,50,59,68,79,92,107,125,148,175,211);
# 2,5,9,12,16,21,25,31,37,43,50,59,68,79,92,107,125,148,175,211,259,325,425,592,925,1926
#7 my @data = (5,13,22,32,43,55,70,86,105,128,156,189);
# 5,13,22,32,43,55,70,86,105,128,156,189,231,285,356,457,607,858,1359,2864
#8 my @data = (35,45,56,69,84,100,120,142,169,200);
# 3,10,17,26,35,45,56,69,84,100,120,142,169,200,239,288,350,434,550,725,1017,1600,3352
#9 my @data = (34,49,66,85,107,134,165,204);
# 10,21,34,49,66,85,107,134,165,204,253,315,399,515,690,982,1565,3315
#10 my @data = (10,26,43,62,83,107,134,165,201,242,291,351,423,513,629,784,1001,1326,1867,2951,6201);
#11 my @data = (142,160,179,201);
# 8,15,23,32,41,50,61,72,84,97,110,125,142,160,179,201,224,250,280,313,350,393,443,500,569,650,751,876,1036,1251,1551,2001,2751,4253,8759
#12 my @data = (35,42,50,60,71,85,100);
# 35,42,50,60,71,85,100,120,144,175,217,275,363,509,801,1677
#14 my @data = (63,73,84,97,113,132,157,188,230,288);
# 3,5,8,11,14,18,21,26,30,35,41,47,55,63,73,84,97,113,132,157,188,230,288
#15 my @data = (2,4,6,8,10,13,16,19,22,25,29,34,39,44,50,57,66,75,87);
# 2,4,6,8,10,13,16,19,22,25,29,34,39,44,50,58,66,75,87,101,116,138,165,201
#16 my @data = (701,1189,1452);
# 33,34,39,42,44,50,52,58,63,66,75,77,87,94,101,117,138,146,165,188,201,251,326,355,451,563,
#17 my @data = (449,699,1448);
# 2,4,6,8,11,13,16,19,22,25,29,34,39,44,50,58,66,75,87,101,117,138,164,200,250,325,449,699,1448
#18 my @data = (32,42,54,68,84);
#19 my @data = (2,5,9,12,16,21,25,31,37,43,50,59,68,79,92,107,125,148,175,211,259);
#20 my @data = (6,12,18,25,33,42,52,63,75,90,106,125,148,175,209);
# 6,12,18,25,33,42,52,63,75,90,106,125,148,175,209,250,304,375,476,626,876,1376,2878
#21 my @data = (5,10,16,21,28,35,42,51,60,70,81,94,109,126,145,167,194,226,264,313,376,459,576,751);
# 1,5,10,16,21,28,35,42,51,60,70,81,94,109,126,145,167,194,226,264,313,376,459,576,751,1043,1627,3379
#22 my @data = (5,11,18,26,34,44,54,66,79,95,113,133,158,187,223,268,325,402,509,671,939,1477,3089);
#25 my @data = (3,9,15,22,29,37,46,55,65,75,87,100,115,131,149,169,192,218,248,283,324,374,435,511,609,739,922,1196,1652,2565,5304);
#26 my @data = (10,29,49,72,98,127,160,199,244,297,360,438,535,660,827,1060,1410,1994,3160,6660);
my @data = ();
#my @data = ();
my $len = @data;

print $len,"\n";

my $b = $data[$len-1] - 2*$data[$len-2];
my $a = $data[$len-1] + $b;

$a = 2500;
$b = 120;

my $i = 0;
my $ai = 0;
my $bi = 0;
my $check = 1;
for($ai=-1000;$ai<0;$ai++){
for($bi=-100;$bi<0;$bi++){
$check=1;
#my $r=0;
for($i=1;$i<=$len;$i++){
#	my $pre = $r+1;
	my $y = ($a+$ai)/($data[$len-$i]+($b+$bi));
	my $r = sprintf("%d", $y);
	$r++;
	$y = ($a+$ai)/($data[$len-$i]-1+($b+$bi));
	my $r2 = sprintf("%d", $y);
#	print $data[$len-$i].".".$r.":".$i." ";
#	if($r!=$i){$check=0;last;}
#	if($pre!=1 && $r!=$pre){$check=0;last;}
	if($r2!=$r){$check=0;last;}
}
#print "\n";
if($check==1){last;}
}
if($check==1){last;}
}

for($i=1;$i<20;$i++){
	my $x = (($a+$ai)/$i)-($b+$bi);
	my $r = sprintf("%d", $x);
	$r++;
	my $s = $i*40;
	print $x." ".$s."\n";
}
my $ar = $a + $ai;
my $br = $b + $bi;
print $ar." ".$a." ".$ai."\n";
print $br." ".$b." ".$bi."\n";
print $check,"\n";
exit;